import { createApp } from 'vue'
import App from './App.vue'
import router from '@/router'
import piniaPluginPersist from 'pinia-plugin-persist'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import svgIcon from './components/svgIcon/SvgIcon.vue'
import zhCn from 'element-plus/lib/locale/lang/zh-cn'

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
const pinia = createPinia()
pinia.use(piniaPluginPersist)
app
  .use(router)
  .use(pinia)
  .component('svg-icon', svgIcon)
  .use(ElementPlus, { locale: zhCn })
  .mount('#app')
